home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / DA / Q-R / RESEXPRESS 1.0.CPT / ResExpress 1.0 / ResX DevKit / Think C Library / snd player.c < prev   
Encoding:
C/C++ Source or Header  |  1991-07-06  |  1.3 KB  |  58 lines  |  [TEXT/KAHL]

  1. /* ************************************************************** *\
  2. To compile in Think C:
  3.    1) Set Project Type to 'Code Resource' 
  4.    2) Set the File TYPE to 'RXXT' and File Creator to 'ResX'
  5.    3) Set the Resource TYPE to 'RXVW' 
  6.    4) Set the Resource NAME to 'snd '. 
  7.    5) Add this file, MacTraps, and ResX Utils.lib to the project 
  8.    6) Compile the code resource. 
  9.    7) Install it in ResX via the 'Externals->Install' menu. 
  10. \* ************************************************************** */
  11.  
  12.  
  13. #include "ResX Utils.h"
  14. #include "Duplicate.h"
  15. #include "MacTypes.h"
  16. #include "QuickDraw.h"
  17. #include "DeviceMgr.h"
  18. #include "EventMgr.h"
  19. #include "FileMgr.h"
  20. #include "MemoryMgr.h"
  21. #include "ResourceMgr.h"
  22. #include "WindowMgr.h"
  23. #include "SetUpA4.h"
  24. #include "String.h"
  25. #include "SoundMgr.h"
  26.  
  27. #define      TRUE   1
  28. #define      FALSE  0
  29. #define      NIL    0
  30.  
  31.  
  32. /* Start of code resource */
  33. pascal void main(TheHandle)
  34. Handle TheHandle;
  35. {
  36. SignedByte    HState;
  37. SndChannelPtr     sndChan;
  38. OSErr    sndErr;
  39.  
  40.     RememberA0();
  41.     SetUpA4();
  42.     HState = HGetState(TheHandle);          
  43.  
  44.     LoadResource(TheHandle);
  45.     HLock(TheHandle);
  46.  
  47.     sndChan = NIL;    
  48.     if ( ResError() == 0 && TheHandle != NIL) {
  49.         sndErr = SndPlay(sndChan,TheHandle,TRUE);
  50.         }
  51.     else
  52.         OKAlert("\pCould not load the resource.");
  53.     
  54.     HUnlock(TheHandle);
  55.     HSetState(TheHandle, HState);          
  56.     RestoreA4()
  57. }
  58. /* End of code resource */